
package ga;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;

public class Population {

    public Population(){};
    
    public Population(int populationSize){
        this.populationSize = populationSize;
    }
    
    private List<Individuum> population = new ArrayList<Individuum>();
    private int populationSize;

    public List<Individuum> getPopulation() {
        return population;
    }
    
    public Individuum getIndividuumAt(int i){
        return getPopulation().get(i);
    }
    

//    public void setPopulation(ArrayList<Individuum> population) {
//        this.setPopulation(population);
//    }
//    
    public void addIndividuum(Individuum i){
        getPopulation().add(i);
    }
    
    public String toString(){
        String res = "population:\n";
        for(int i = 0; i < getPopulation().size(); i++){
            System.out.println(getPopulation().get(i).toString());
            res = res + getPopulation().get(i).toString();
        }
        return res;
    }
    
    public void setPopulation(List<Individuum> population) {
        this.population = population;
    }
}
